home *** CD-ROM | disk | FTP | other *** search
- package sun.swing;
-
- import java.lang.reflect.InvocationTargetException;
- import java.lang.reflect.Method;
- import java.security.AccessController;
- import java.security.PrivilegedActionException;
-
- public class AccessibleMethod {
- private final Method method;
-
- public AccessibleMethod(Class var1, String var2, Class... var3) throws NoSuchMethodException {
- try {
- this.method = (Method)AccessController.doPrivileged(new AccessMethodAction(var1, var2, var3));
- } catch (PrivilegedActionException var5) {
- throw (NoSuchMethodException)var5.getCause();
- }
- }
-
- public Object invoke(Object var1, Object... var2) throws IllegalArgumentException, InvocationTargetException {
- try {
- return this.method.invoke(var1, var2);
- } catch (IllegalAccessException var4) {
- throw new AssertionError("accessible method inaccessible");
- }
- }
-
- public Object invokeNoChecked(Object var1, Object... var2) {
- try {
- return this.invoke(var1, var2);
- } catch (InvocationTargetException var4) {
- if (var4.getCause() instanceof RuntimeException) {
- throw (RuntimeException)var4.getCause();
- } else {
- throw new RuntimeException(var4.getCause());
- }
- }
- }
- }
-